package myblog.action;

import java.util.ArrayList;
import java.util.List;

import myblog.service.LogService;
import myblog.vo.LogsVo;

import com.opensymphony.xwork2.ActionSupport;

public class LogAction extends ActionSupport {

	private LogService service;

	private List<LogsVo> logList = new ArrayList<LogsVo>();

	private LogsVo log =null;

	private String logid;

	public String list() {

		logList = service.list();

		return "list";
	}

	public String del() {

		service.dellog(logid);

		return "list";
	}

	public String add() {

		service.addlog(log);

		return "list";
	}

	public String findlogBylogid() {

		log = service.getlog(logid);

		return "update";
	}

	public String update() {

		service.editlog(log);

		return "list";
	}

	public void setService(LogService service) {
		this.service = service;
	}

	public List<LogsVo> getLogList() {
		return logList;
	}

	public void setLogList(List<LogsVo> logList) {
		this.logList = logList;
	}

	public LogsVo getLog() {
		return log;
	}

	public void setLog(LogsVo log) {
		this.log = log;
	}

	public String getLogid() {
		return logid;
	}

	public void setLogid(String logid) {
		this.logid = logid;
	}

}
